package org.crmsystem.service.impl;

import org.crmsystem.dao.IHandleLogMapper;
import org.crmsystem.model.HandleLog;
import org.crmsystem.service.IHandleLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/8/4.
 */
@Service
public class HandleLogServiceImpl implements IHandleLogService{

    @Autowired
    private IHandleLogMapper handleLogMapper;

    /**
     * 添加操作日志
     * @param handleLog
     * @return
     */
    public int insertHandleLog(HandleLog handleLog) {
        int flag = handleLogMapper.insertHandleLog(handleLog);
        return flag;
    }

    /**
     * 删除操作日志
     * @param id
     * @return
     */
    public int deleteHandleLog(int id){
        int flag = handleLogMapper.deleteHandleLog(id);
        return flag;
    }

    /**
     * 根据id查询日志信息
     * @param id
     * @return
     */
   public HandleLog getHandleLogById(int id){
        return handleLogMapper.getHandlelogById(id);
    }


    /**
     * 根据关键字查询日志

     * @return
     */
    public List<HandleLog> getHandleLogByKeyword(Map map) {
        List<HandleLog> list =handleLogMapper.getHandleLogByKeyword(map);
        return list;
    }

    /**
     * 修改日志
     * @param handleLog
     * @return
     */
    public int updateHandleLog(HandleLog handleLog){
       return handleLogMapper.updateHandleLog(handleLog);
    }

    /**
     * 获取数据总条数
     * @param map
     * @return
     */
    public int getLogCount(Map map){
        return handleLogMapper.getLogCount(map);
    }
}
